<template>
	<view>
		 <web-view :src="url" @message="onMessage"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				 url:''
			}
		},
		 onLoad(item) {
				this.url = item.url
		  },
		methods: {
			onMessage(event) {
			    console.log(event);
			    // 关闭Webview
			    if (event.detail.data[0].action == 'closeWebview') {
			     const currentWebview = this.$scope.$getAppWebview();
			     currentWebview.children()[0].clear();
			     uni.navigateBack();
			    }
			   }
			
		}
	}
</script>

<style>

</style>
